package client.ui.panel;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;

import client.EventBus;
import client.events.PatientSearch;
import client.events.ViewHome;
import client.events.ViewInvoice;
import client.service.PatientService;
import domain.user.User;

public class InvoicePanel extends DefaultPanel{

	
	private class ButtonListener implements ActionListener {
		public void actionPerformed(ActionEvent event) {
			if (event.getSource().equals(homeButton)) {
				EventBus.BUS.fireEvent(new ViewHome(null));
			} else if (event.getSource().equals(invoiceButton)) {
				EventBus.BUS.fireEvent(new ViewInvoice(null));
			} else if (event.getSource().equals(searchGo)) {
				List<User> resultsList = PatientService.findPatients(search.getText());
				EventBus.BUS.fireEvent(new PatientSearch(resultsList));
			}
		}
	}
}
